<template>
  <div class="mr-2 overflow-hidden bg-white">
    <BasicTree
      :title="t('日志类型')"
      :toolbar="false"
      :search="false"
      :treeData="treeData"
      :selectedKeys="['1']"
      @select="handleSelect"
    />
  </div>
</template>
<script lang="ts">
  import { useI18n } from '/@/hooks/web/useI18n';
  const { t } = useI18n();
  import { defineComponent, onMounted } from 'vue';

  import { BasicTree } from '/@/components/Tree';
  import { treeData } from './data';
  export default defineComponent({
    name: 'DeptTree',
    components: { BasicTree },

    emits: ['select'],
    setup(_, { emit }) {
      function handleSelect(keys: string) {
        let obj = treeData.find((o) => {
          return o.key == keys[0];
        });
        emit('select', obj);
      }

      onMounted(() => {});
      return { treeData, handleSelect, t };
    },
  });
</script>
